import {callApi} from "./axios";

// 标签
let url= {
    saveArticle: "/article/addOrChange", // 保存文章
    countTotal: "/article/countTotal", // 查询文章总数
    listSimple: "/article/listSimple", // 查询文章总数
    getArticle: "/article/get", // 获取文章
    deleteArticle: "/article/delete", // 删除文章
    uploadArticleImg: "/article/img/upload", // 上传图片
    getUploadDirNum: "/article/getUploadDirNum", // 获取下次图片上传存放的文件夹序号
    download: "/article/download", // 下载文章
};


export default {
    saveArticle: params => callApi("post", url.saveArticle, params),
    countTotal: params => callApi("get", url.countTotal, params),
    listSimple: params => callApi("get", url.listSimple, params),
    getArticle: params => callApi("get", url.getArticle, params),
    deleteArticle: params => callApi("post", url.deleteArticle, params),
    uploadArticleImg: params => callApi("post", url.uploadArticleImg, params),
    getUploadDirNum: params => callApi("get", url.getUploadDirNum, params),
    download: () => url.download, // 下载文章
}

